namespace KanbanBoard.Data.NHibernateMaps.Conventions
{
    using FluentNHibernate.Conventions;
    using FluentNHibernate.Conventions.Instances;

    public class PrimaryKeyConvention : IIdConvention
    {
        public void Apply(IIdentityInstance instance)
        {
            instance.Column(Inflector.Net.Inflector.Camelize(instance.EntityType.Name) + "Id");
            instance.UnsavedValue(0.ToString());
            instance.GeneratedBy.Identity();
        }
    }
}